function [ y] = mis( theta, id)
load('mainfile1.mat')

alpha=theta(1);
beta=theta(2:6); % <1x5 double>
mu=theta(7:31);  % <1x25 double>
chi=theta(34:58);% <1x25 double>
rho=theta(59:63);
c=theta(64);

sum=0;
n=find(consumer_id==id);
k=dimension(n(1));
m1=n(1);
m2=n(1)+k-1;
s= brandid(m1:m2)';
for i=1:1:k
    j=s(i);
    delta= mu(j) + x(n(1),:)*beta'+alpha*chi(j);
    sum=sum+exp(delta);
end 
cost=c+x(n(1),:)*rho';
y=log(1+sum)-k*cost;
end

